<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>订单确认</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="/js/layui/css/layui.css"  media="all">
        <link rel="stylesheet" href="/js/layui/css/login.css"  media="all">
        <style>
            .btn-delete {
                color:#CCCCCC;
            }
        </style>
    </head>
    <body class="layui-layout-body">
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header" style="margin-top:50px;">
                <h2>订单确认</h2>
            </div>
            <form class="layui-form" action="">
                <input id="hide_id" type="hidden" name="id" value="<?php echo $data['id'];?>">
                <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                    <?php foreach($lists as $v){?>
                   <div class="layui-form-item">
                       <label class="layui-form-label" style="color: #999999;"><?php echo $v['name'];?></label>
                    <div class="layui-input-block" style="padding-top: 10px;margin-left: 130px;font-weight: bold;">
                        <?php echo $v['values'];?>
                        
                    </div>
                  </div>
                    <?php }?>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="color: #999999;">安全码</label>
                        <div class="layui-input-block">
                            <input id="password" name="password" lay-verify="pass" placeholder="请输入安全码" autocomplete="off" class="layui-input" type="password">
                    </div>
                        
                    <div class="layui-form-item" style="margin-top:10px;">
                        <label class="layui-form-label" style="color: #999999;">确认金额</label>
                        <div class="layui-input-block">
                            <input id="amount" name="amount" value="<?php echo $data['amount'];?>"  placeholder="不填则为用户实际金额" autocomplete="off" class="layui-input" type="amount">
                    </div>
                        
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn layui-btn-fluid" lay-submit="1" lay-filter="demo1" style="background-color: #ff9900">审核通过</button>
                    </div>
                    <div class="layui-form-item">
                        <a class="layui-btn layui-btn-fluid" id="onback" >驳回</a>
                    </div>
                </div>
            </form>
        </div>

        <script src="/js/layui/layui.js" charset="utf-8"></script>
        <script src="/js/jquery.js" charset="utf-8"></script>
        <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
        <script>
            var flag = 0;
                layui.use(['form','layer'], function () {
                    var form = layui.form;
                    //自定义验证规则
                    form.verify({
                        pass: [/(.+){6,12}$/, '安全码必须6到12位'],
                    });
                    //监听提交
                    form.on('submit(demo1)', function (data) {
                        var index = layer.load(1, {
                            shade: [0.5,'#ccc'] //0.1透明度的白色背景
                        });
                        $.post('/eorder/recharge.do', $('form').serialize(), function (res) {
                            layer.close(index);
                            if(res.status==1) {
                                window.location.href='/eorder/success.do';
                            }else {
                                layer.msg(res.msg);
                                return false;
                            }
                        }, 'json');
                        return false;
                    });
                    $(document).on('click','#onback',function(){
                        var form = layui.form;
                        //自定义验证规则
                        form.verify({
                            pass: [/(.+){6,12}$/, '安全码必须6到12位'],
                        });
                        var index = layer.load(1, {
                            shade: [0.5,'#ccc'] //0.1透明度的白色背景
                        });
                        $.post('/eorder/rechargeno.do',{id:$('#hide_id').val(),'password':$('#password').val()}, function (res) {
                            layer.close(index);
                            if(res.status==1) {
                                window.location.href='/eorder/success.do';
                            }else {
                                layer.msg(res.msg);
                                return false;
                            }
                        }, 'json');
                        return false;
                    });
                    
                });
        </script>
    </body>
</html>